// TestMilo.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>

// template method of even
template<typename T>
inline T even(T x)
{
	return x % 2 == 0 ? -1 : 1;
}

// Sign function : y = sgn(x)
// while X > 0, Y = 1; while X < 0, Y = -1; while X = 0, Y = 0
template <typename T>
inline T sgn(T x)
{
	if (x > 0)
	{
		return 1;
	}
	else if (x < 0)
	{
		return -1;
	} 
	else
	{
		return 0;
	}
}

//
template<typename T>
struct f1 
{
	T operator()(T x)
	{
		return even(x) * x + sgn(x);
	}
};

int _tmain(int argc, _TCHAR* argv[])
{
	return 0;
}

